package com.dl.tt.control;

import java.io.File;
import java.io.IOException;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.dl.tt.bean.UserForm;

// http://localhost:8080/userform/getdata
@Controller
public class FormControl {

	public FormControl() {
		System.out.println("------------------------------FormControl#-----------------------");
	}

	@RequestMapping("/uf")
	public String getData(UserForm uf) throws Exception {

			System.out.println("------------------FormControl#getData--------------------");
		
		uf.getFile().transferTo(new File("D:\\WorkDir\\2021\\6\\0602\\" + uf.getFile().getOriginalFilename()));

		System.out.println(uf);

		return "ok";
	}
	
	
	@RequestMapping("/ok")
	public String ok() {
		
		System.out.println("------------ok------------");
		return "ok";
	}
	
	
	
	
	
	
	
	
}
